<!DOCTYPE html>
<html lang="zh-cn">

<head>

  <meta content="text/html;charset=utf-8" http-equiv="content-type">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">

  <title>滑雪族 - 主办方信息</title>

  <!-- Bootstrap Core CSS -->
<!-- MetisMenu CSS -->
<!-- Custom CSS -->
<!-- Custom Fonts -->
  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
  <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
  <![endif]-->  <!--webuploader 引入CSS-->
    <link rel="stylesheet" href="/server/r/bower_components/bootstrap/dist/css/bootstrap.min.css" />
    <link rel="stylesheet" href="/server/r/bower_components/metisMenu/dist/metisMenu.min.css" />
    <link rel="stylesheet" href="/server/r/static/css/sb-admin-2_e507c2b.css" />
    <link rel="stylesheet" type="text/css" href="/server/r/bower_components/font-awesome/css/font-awesome.min.css" />
    <link type="text/css" rel="stylesheet" href="/server/r/static/css/hxz/common_2baa698.css" />
    <link rel="stylesheet" type="text/css" href="/server/r/bower_components/alertify/themes/alertify.core.css" />
    <link rel="stylesheet" type="text/css" href="/server/r/bower_components/alertify/themes/alertify.bootstrap.css" />
    <link type="text/css" rel="stylesheet" href="/server/r/vendor/umeditor/themes/default/css/umeditor.css" />
    <link rel="stylesheet" type="text/css" href="/server/r/bower_components/fex-webuploader/dist/webuploader.css" />
</head>

<body>

<div id="wrapper">

  <!-- Navigation -->
  <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">

    <div class="navbar-header">
  <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
    <span class="sr-only">Toggle navigation</span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
  </button>
  <a class="navbar-brand" href="activity-list">滑雪族 管理</a>
</div>
<!-- /.navbar-header -->

<ul class="nav navbar-top-links navbar-right">
  <!-- /.dropdown -->
  <li class="dropdown">
    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
      <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
    </a>
    <ul class="dropdown-menu dropdown-user">
      <li><a href="/manage/logout"><i class="fa fa-sign-out fa-fw"></i> 退出系统</a>
      </li>
    </ul>
    <!-- /.dropdown-user -->
  </li>
  <!-- /.dropdown -->
</ul>
<!-- /.navbar-top-links -->

    <div class="navbar-default sidebar" role="navigation">
      <div class="sidebar-nav navbar-collapse">
        <ul class="nav" id="side-menu">
  <li>
    <a href="#"><i class="fa fa-asterisk fa-fw"></i> 产品管理<span class="fa arrow"></span></a>
    <ul class="nav nav-second-level">
      <li>
        <a href="/manage/activity-list"> 产品查询</a>
      </li>
      <li>
        <a href="/manage/manage-organizer-render-activity"> 产品显示控制</a>
      </li>
    </ul>
    <!-- /.nav-second-level -->
  </li>
  <li>
    <a href="/#"><i class="fa fa-male fa-fw"></i> 报名管理<span class="fa arrow"></span></a>
    <ul class="nav nav-second-level">
      <li>
        <a href="/manage/player-list"> 报名查询</a>
      </li>
    </ul>
  </li>
  <li>
    <a href="#"><i class="fa fa-list-alt fa-fw"></i> 订单管理<span class="fa arrow"></span></a>
    <ul class="nav nav-second-level">
      <li>
        <a href="/manage/order-list"> 订单查询</a>
      </li>
      <li>
        <a href="/manage/refund-list"> 退款管理</a>
      </li>
    </ul>
    <!-- /.nav-second-level -->
  </li>
  <li>
    <a href="#"><i class="fa fa-check-circle fa-fw"></i> 主办方认证<span class="fa arrow"></span></a>
    <ul class="nav nav-second-level">
      <li>
        <a href="/manage/organizer-edit"> 创建主办方</a>
      </li>
      <li>
        <a href="/manage/organizer-list"> 主办方列表</a>
      </li>
      <li>
        <a href="/manage/organizer-print"> 冬令营打印设置</a>
      </li>

    </ul>
    <!-- /.nav-second-level -->
  </li>
  <li>
    <a href="#"><i class="fa fa-picture-o fa-fw"></i> 雪场管理<span class="fa arrow"></span></a>
    <ul class="nav nav-second-level">
      <li>
        <a href="/manage/ski-field-edit"> 创建雪场</a>
      </li>
      <li>
        <a href="/manage/ski-field-list"> 雪场列表</a>
      </li>

    </ul>
    <!-- /.nav-second-level -->
  </li>
  <li>
    <a href="#"><i class="fa fa-users fa-fw"></i> 教练管理<span class="fa arrow"></span></a>
    <ul class="nav nav-second-level">
      <li>
        <a href="/manage/coach-list"> 预约情况</a>
      </li>
    </ul>
    <!-- /.nav-second-level -->
  </li>
  <li>
    <a href="#"><i class="fa fa-credit-card fa-fw"></i> 结算管理<span class="fa arrow"></span></a>
    <ul class="nav nav-second-level">
      <li>
        <a href="/manage/manage-transfer-list"> 转账管理</a>
      </li>
      <li>
        <a href="/manage/manage-withdrawals-apply-list"> 提现申请</a>
      </li>
      <li>
        <a href="/manage/manage-withdrawals-record-list"> 结算列表</a>
      </li>
    </ul>
    <!-- /.nav-second-level -->
  </li>
  <li>
    <a href="#"><i class="fa fa-rmb fa-fw"></i> 财务管理<span class="fa arrow"></span></a>
    <ul class="nav nav-second-level">
      <li>
        <a href="/manage/stream-list"> 交易流水</a>
      </li>
      <li>
        <a href="/manage/manage-bill-record-list"> 对账列表</a>
      </li>
    </ul>
    <!-- /.nav-second-level -->
  </li>
  <li>
    <a href="#"><i class="fa fa-dollar fa-fw"></i> 营销管理<span class="fa arrow"></span></a>
    <ul class="nav nav-second-level">
      <li>
        <a href="/manage/marketing-list"> 返利管理</a>
      </li>
    </ul>
    <!-- /.nav-second-level -->
  </li>
  <li>
    <a href="#"><i class="fa fa-comments fa-fw"></i> 评价管理<span class="fa arrow"></span></a>
    <ul class="nav nav-second-level">
      <li>
        <a href="/manage/comment-list">评价管理</a>
      </li>
    </ul>
  </li>
  <li>
    <a href="#"><i class="fa fa-tasks fa-fw"></i> 定时处理管理<span class="fa arrow"></span></a>
    <ul class="nav nav-second-level">
      <li>
        <a href="/manage/quartz-list"> 定时处理列表</a>
      </li>
    </ul>
    <!-- /.nav-second-level -->
  </li>
  <li>
    <a href="#"><i class="fa fa-wechat fa-fw"></i> 微信页面管理<span class="fa arrow"></span></a>
    <ul class="nav nav-second-level">
      <li>
        <a href="/manage/typography-list"> 微信首页管理</a>
      </li>
      <li>
        <a href="/manage/activity-weight-manage"> 活动置顶</a>
      </li>
    </ul>
    <!-- /.nav-second-level -->
  </li>
</ul>
      </div>
      <!-- /.sidebar-collapse -->
    </div>
    <!-- /.navbar-static-side -->
  </nav>

  <div id="page-wrapper">

    <div class="row">
      <div class="col-lg-12">
        <h3 class="page-header">打印页面设置</h3>
      </div>
      <!-- /.col-lg-12 -->
    </div>
    <!-- /.row -->
    <div class="row">
      <div class="col-lg-12">
        <div class="panel panel-default">
          <div class="panel-heading">
            主办方详情
          </div>
          <div class="panel-body">
            <div class="row">
              <div class="col-lg-8 col-md-offset-1">
                <form role="form" id="form-activity-add">

                  <input id="organizer-tpl-id" value="${(organizerTplId)!'0'}" type="hidden"/>
                  <input id="result-organizer-id" value="${(printResult.organizerId)!''}" type="hidden"/>
                  <input id="result-tplType" value="${(printResult.tplType)!''}" type="hidden"/>
                  <input id="result-valid" value="${(printResult.valid)!''}" type="hidden"/>

                  <div class="form-group form-require">
                    <label>主办方</label>
                    <select id="organizer-id" class="form-control" style="width: 300px;">
                      <option value="0">请选择主办方</option>
                      <#list organizerList as or>
                        <option value="${or.id}">${or.text}</option>
                      </#list>
                    </select>

                    <p class="help-block">请选择主办方</p>
                  </div>

                  <div class="form-group form-require" id="organizer-tpl-type">
                    <label>模板类型</label>
                    <select id="print-type" class="form-control" style="width: 300px;">
                      <option value="0">请选择模板类型</option>
                      <option value="camp-player">冬令营模板</option>
                    </select>
                  </div>

                  <div class="form-group form-require" id="product-type">
                    <label>模板路径</label>
                    <input id="organizer-tpl-path" class="form-control " style="width: 300px;" required value="${(printResult.tplPath)!''}">
                  </div>

                  <div class="form-group form-require" id="form-organizer-print-valid">
                    <label>模板路径</label>
                    <div>
                      <input id="organizer-print-valid-0" type="radio" name="tplValid" value="0" width="60px">无效
                      <input id="organizer-print-valid-1" type="radio" name="tplValid" value="1" width="60px" checked>有效
                    </div>
                  </div>

                  <div class="form-group">
                    <label>模板代码</label>
                  </div>

                  <div class="form-group">
                    <textarea id="tpl-source" class="form-control" style="width: 100%; height: 600px;resize: none">${(source)!''}</textarea>
                  </div>

                  <div class="form-group">
                    <a id="organizer-print-add" href="javascript:void(0);" class="btn btn-primary">保存</a>
                    <a id="activity-cannel-btn" href="/manage/organizer-print" class="btn btn-default">取消</a>
                  </div>
                </form>
              </div>
            </div>
            <!-- /.row (nested) -->
          </div>
          <!-- /.panel-body -->
        </div>
        <!-- /.panel -->
      </div>
      <!-- /.col-lg-12 -->
    </div>
    <!-- /.row -->
  </div>
  <!-- /#page-wrapper -->

</div>
<!-- /#wrapper --><div id="hxz-background" class="background" style="display: none; "></div>
<div id="hxz-progressBar" class="progressBar" style="display: none; ">数据加载中，请稍等...</div>

<script src="/server/r/require.js"></script>
<script type="text/javascript">/*resourcemap*/
require.config({paths:{
  "r/bower_components/jquery/dist/jquery.min": "/server/r/bower_components/jquery/dist/jquery.min",
  "r/bower_components/underscore/underscore-min": "/server/r/bower_components/underscore/underscore-min",
  "r/static/js/hxz/hxz.valid": "/server/r/static/js/hxz/hxz.valid_12cc206",
  "r/static/js/hxz/hxz.rest": "/server/r/static/js/hxz/hxz.rest_07c8105",
  "r/bower_components/alertify/alertify.min": "/server/r/bower_components/alertify/alertify.min",
  "r/static/js/alertify-config": "/server/r/static/js/alertify-config_0cc8db2",
  "r/bower_components/bootstrap/dist/js/bootstrap.min": "/server/r/bower_components/bootstrap/dist/js/bootstrap.min",
  "r/bower_components/metisMenu/dist/metisMenu.min": "/server/r/bower_components/metisMenu/dist/metisMenu.min",
  "r/bower_components/select2/dist/js/select2": "/server/r/bower_components/select2/dist/js/select2",
  "r/static/js/hxz/hxz.ui": "/server/r/static/js/hxz/hxz.ui_0a7714d",
  "r/static/js/hxz/hxz": "/server/r/static/js/hxz/hxz_589b155",
  "r/vendor/umeditor/umeditor.config": "/server/r/vendor/umeditor/umeditor.config",
  "r/vendor/umeditor/umeditor": "/server/r/vendor/umeditor/umeditor"
}});

  require(['r/bower_components/jquery/dist/jquery.min', 'r/static/js/hxz/hxz', "r/vendor/umeditor/umeditor", "r/static/js/alertify-config"], function ($, hxz, UM, alertify) {

    function event() {
      $("#organizer-print-add").click(function () {
        var organizerId = $("#organizer-id").val();
        var tplType = $("#print-type").val();
        var tplPath = $("#organizer-tpl-path").val();
        var tplSource = $("#tpl-source").val();

        var tplId = $("#organizer-tpl-id").val();

        var tplValid = document.getElementsByName("tplValid");
        var tplValidValue = 1;

        for (var i = 0; i < tplValid.length; i++) {
          if (tplValid[i].checked) {
            tplValidValue = tplValid[i].value;
          }
        }

        if (organizerId == 0) {
          alertify.log("请选择主办方");
          return;
        }

        if (tplType == 0) {
          alertify.log("请选择模板类型");
          return;
        }

        if (tplPath && tplPath.length == 0) {
          alertify.log("请输入模板路径");
          return;
        }

        if (tplSource && tplSource.length == 0) {
          alertify.log("请输入源代码");
          return;
        }

        var data = {
          tplId: tplId,
          organizerId :  organizerId,
          tplType:tplType,
          tplPath:tplPath,
          tplSource:tplSource,
          tplValid: tplValidValue
        };

        hxz.doPost({url: hxz.RestApi.manageOrganizerPrintEdit, data: data}, function (data) {

          if (data.status == 0) {
            return alertify.log(data.data)
          }

          if (tplId == 0) {
            if(data.status == 1) {
              $("#organizer-tpl-id").val(data.data);
              alertify.log("模板创建成功");
            }
          } else {
            if(data.status == 1) {
              alertify.log("更新成功");
            }
          }
        });

      });
    }

    event();

    function init() {
      var tplId = $("#organizer-tpl-id").val();
      if (tplId != 0) {
        var organizerId = $("#result-organizer-id").val();
        var tplType = $("#result-tplType").val();
        var tplValidValue = $("#result-valid").val();
        $("#organizer-id").val(organizerId)
        $("#print-type").val(tplType)

        var tplValid = document.getElementsByName("tplValid");

        for (var i = 0; i < tplValid.length; i++) {
          if (i == tplValidValue) {
            tplValid[i].checked = true;
          } else {
            tplValid[i].checked = false;
          }
        }
      }
    }
    init();



  });
</script>
</body>
</html>
<!--version:-->